package com.xscr.api.service.user;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.InputStream;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import org.apache.commons.lang.StringUtils;
import org.csource.upload.UploadFileUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.util.FileCopyUtils;

import com.rop.annotation.HttpAction;
import com.rop.annotation.IgnoreSignType;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import com.rop.response.Response;
import com.xscr.api.pojo.CouponDTO;
import com.xscr.api.pojo.ImageDTO;
import com.xscr.api.pojo.OrderDTO;
import com.xscr.api.pojo.TopicDTO;
import com.xscr.api.pojo.UserDTO;
import com.xscr.api.request.BindMobileRequest;
import com.xscr.api.request.GetCartRequest;
import com.xscr.api.request.GetOrderDetailRequest;
import com.xscr.api.request.GetOrderRequest;
import com.xscr.api.request.GetPayInfoRequest;
import com.xscr.api.request.GetUserInfoRequest;
import com.xscr.api.request.GetVerifyCodeRequest;
import com.xscr.api.request.LoginRequest;
import com.xscr.api.request.RegisterRequest;
import com.xscr.api.request.SaveUserInfoRequest;
import com.xscr.api.request.UpdatePasswordRequest;
import com.xscr.api.request.UploadUserPhotoRequest;
import com.xscr.api.service.order.OrderAction;
import com.xscr.architect.redis.JedisManager;
import com.xscr.forum.po.ForumImage;
import com.xscr.forum.po.ForumTopic;
import com.xscr.forum.service.ForumImageService;
import com.xscr.forum.service.ForumTopicService;
import com.xscr.mybatis.utility.PageBean;
import com.xscr.order.api.OrderEvaluationService;
import com.xscr.order.api.OrderPayDetailService;
import com.xscr.order.po.OrderEvaluation;
import com.xscr.order.po.OrderPayDetail;
import com.xscr.promotion.api.CouponService;
import com.xscr.promotion.dto.ProDto;
import com.xscr.sendMessage.SendSMS;
import com.xscr.user.po.User;
import com.xscr.user.service.UserService;
import com.xscr.user.utils.MD5Util;

@ServiceMethodBean(version = "1.0", ignoreSign = IgnoreSignType.NO)
public class UserAction {
	private static final Logger logger=LoggerFactory.getLogger(UserAction.class);

	@Autowired
	private UserService userService;

	@Autowired
	CouponService couponService;

	@Autowired
	private ForumTopicService forumTopicService;

	@Autowired
	private ForumImageService forumImageService;

	@Autowired
	private OrderPayDetailService orderPayDetailService;

	@Autowired
	private OrderEvaluationService orderEvaluationService;

	/**
	 * 登录
	 * @param loginRequest
	 * @return
	 */
	@ServiceMethod(method = "user.login", version = "1.0", needInSession = NeedInSessionType.NO, httpAction = HttpAction.POST)
	public Response login(LoginRequest loginRequest) {
		Response response = new Response();
		String msg = "";

		String account = loginRequest.getAccount();
		String password = loginRequest.getPassword();
		
		if(account==null||StringUtils.isBlank(account)||password==null||StringUtils.isBlank(password))
		{
			response.getResult().setResult("0");
			response.getResult().setMessage("参数不合法");
			return response;
		}

		try {
			User user = new User();
			user.setLoginName(account);
			password = MD5Util.md5(password);
			user.setPassword(password);
			user = userService.getUserByNameAndPwd(user);
			if (user == null) {
				response.getResult().setResult("0");
				response.getResult().setMessage("用户名或密码不正确");
				return response;
			}

			response.setData(user);

		} catch (Exception e) {
			logger.error("login error", e);
			response.getResult().setResult("0");
			response.getResult().setMessage("登录错误");
			return response;
		}

		msg = "登录成功";
		response.getResult().setResult("1");
		response.getResult().setMessage(msg);
		return response;
	}

	/**
	 * 注册
	 * @param registerRequest
	 * @return
	 */
	@ServiceMethod(method = "user.register", version = "1.0", needInSession = NeedInSessionType.NO, httpAction = HttpAction.POST)
	public Response register(RegisterRequest registerRequest) {
		Response response = new Response();
		String msg = "";

		Integer gender = registerRequest.getGender();
		String mobile = registerRequest.getMobile();
		String nickName = registerRequest.getNickname();
		String password = registerRequest.getPassword();
		String verifyCode = registerRequest.getVerifyCode();
		
		if(mobile==null||StringUtils.isBlank(mobile)||nickName==null||StringUtils.isBlank(nickName)||password==null||StringUtils.isBlank(password)||verifyCode==null||StringUtils.isBlank(verifyCode))
		{
			response.getResult().setResult("0");
			response.getResult().setMessage("参数不合法");
			return response;
		}
		
		try {
			User user = new User();
			user.setSex(gender);
			user.setMobile(mobile);
			user.setAccountName(nickName);
			user.setLoginName(nickName);
			password = MD5Util.md5(password);
			user.setPassword(password);
			String code = JedisManager.getString(mobile + "MOBILE_VALID");
			if (code.equals(verifyCode)) {
				userService.insertUser(user);
				user = userService.getUserByNameAndPwd(user);
			}
			response.setData(user);

		} catch (Exception e) {
			logger.error("register error", e);
			response.getResult().setResult("0");
			response.getResult().setMessage("注册错误");
			return response;
		}

		msg = "注册成功";
		response.getResult().setResult("1");
		response.getResult().setMessage(msg);
		return response;
	}

	/**
	 * 忘记密码
	 * 
	 * @param registerRequest
	 * @return
	 */
	@ServiceMethod(method = "user.findBackPassword", version = "1.0", needInSession = NeedInSessionType.NO, httpAction = HttpAction.POST)
	public Response findBackPassword(RegisterRequest registerRequest) {
		Response response = new Response();
		String msg = "";

		Integer gender = registerRequest.getGender();
		String mobile = registerRequest.getMobile();
		String nickName = registerRequest.getNickname();
		String password = registerRequest.getPassword();
		String verifyCode = registerRequest.getVerifyCode();
		
		if(mobile==null||StringUtils.isBlank(mobile)||nickName==null||StringUtils.isBlank(nickName)||password==null||StringUtils.isBlank(password)||verifyCode==null||StringUtils.isBlank(verifyCode))
		{
			response.getResult().setResult("0");
			response.getResult().setMessage("参数不合法");
			return response;
		}

		try {
			User user = new User();
			user.setMobile(mobile);
			user = userService.selectUserByParam(user);

			if (user == null) {
				response.getResult().setResult("0");
				response.getResult().setMessage("用户不存在");
				return response;
			}

			String code = JedisManager.getString(mobile + "MOBILE_VALID");
			if (code.equals(verifyCode)) {
				password = MD5Util.md5(password);
				user.setSex(gender);
				user.setAccountName(nickName);
				user.setPassword(password);
				userService.updateByUserId(user);
				response.setData(user);
			}

		} catch (Exception e) {
			logger.error("findBackPassword error", e);
			response.getResult().setResult("0");
			response.getResult().setMessage("找回密码错误");
			return response;
		}

		msg = "找回密码成功";
		response.getResult().setResult("1");
		response.getResult().setMessage(msg);
		return response;
	}

	/**
	 * 获取验证码
	 * 
	 * @param getVerifyCodeRequest
	 * @return
	 */
	@ServiceMethod(method = "user.getVerifyCode", version = "1.0", needInSession = NeedInSessionType.NO, httpAction = HttpAction.GET)
	public Response getVerifyCode(GetVerifyCodeRequest getVerifyCodeRequest) {
		Response response = new Response();
		String msg = "";
		String mobile = getVerifyCodeRequest.getMobile();
		String verifyCode = null;
		
		if(mobile==null||StringUtils.isBlank(mobile))
		{
			response.getResult().setResult("0");
			response.getResult().setMessage("参数不合法");
			return response;
		}
		
		try {
			// 发验证码
			verifyCode = SendSMS.sendValidateCode(mobile).toString();
			JedisManager.setString(mobile + "MOBILE_VALID", verifyCode, 1800);

			Map<String, Object> data = new HashMap<String, Object>(5);

			data.put("verifyCode", verifyCode);

			response.setData(data);
		} catch (Exception e) {
			logger.error("getVerifyCode error", e);
			response.getResult().setResult("0");
			response.getResult().setMessage("获取验证码错误");
			return response;
		}

		msg = "获取验证码成功";
		response.getResult().setResult("1");
		response.getResult().setMessage(msg);
		return response;
	}

	/**
	 * 获取我的的评价
	 * @param getPayInfoRequest
	 * @return
	 */
	@ServiceMethod(method = "user.myEvaluationList", version = "1.0", needInSession = NeedInSessionType.NO, httpAction = HttpAction.GET)
	public Response myEvaluationList(GetCartRequest getCartRequest) {
		Response response = new Response();
		String msg = "";
		Integer page = getCartRequest.getPageCount();
		Long userId = getCartRequest.getUserId();
		
		if(userId==null||StringUtils.isBlank(userId.toString()))
		{
			response.getResult().setResult("0");
			response.getResult().setMessage("参数不合法");
			return response;
		}
		
		List<OrderEvaluation> evaluationList = null;
		try {

			PageBean<OrderEvaluation> pageBean = new PageBean<OrderEvaluation>();
			pageBean.setPageSize(10);
			pageBean.setPage(page);
			pageBean = orderEvaluationService.selectListPageEvaluationByUserId(
					Integer.parseInt(userId.toString()), null, null, true, pageBean);
			evaluationList = pageBean.getResult();
			Map<String, Object> data = new HashMap<String, Object>(5);
			if (evaluationList != null && !evaluationList.isEmpty()) {
				data.put("evaluationList", evaluationList);
				response.setData(data);
			}
		} catch (Exception e) {
			logger.error("myEvaluationList error", e);
			response.getResult().setResult("0");
			response.getResult().setMessage("获取我的的评价错误");
			return response;
		}
		msg = "获取我的的评价成功";
		response.getResult().setResult("1");
		response.getResult().setMessage(msg);
		return response;
	}

	/**
	 * 获取支付信息
	 * 
	 * @param getPayInfoRequest
	 * @return
	 */
	@ServiceMethod(method = "user.getPayInfo", version = "1.0", needInSession = NeedInSessionType.NO, httpAction = HttpAction.GET)
	public Response getPayInfo(GetPayInfoRequest getPayInfoRequest) {
		Response response = new Response();
		String msg = "";

		String orderId = getPayInfoRequest.getOrderId();
		Integer payType = getPayInfoRequest.getPayType();
		
		if(orderId==null||StringUtils.isBlank(orderId))
		{
			response.getResult().setResult("0");
			response.getResult().setMessage("参数不合法");
			return response;
		}
		
		OrderPayDetail payInfo = null;
		try {
			payInfo = orderPayDetailService.getOrderPayDetailByOrderId(Integer
					.valueOf(orderId));
			Map<String, Object> data = new HashMap<String, Object>(5);
			data.put("payInfo", payInfo);
			response.setData(data);
		} catch (Exception e) {
			logger.error("getPayInfo error", e);
			response.getResult().setResult("0");
			response.getResult().setMessage("获取支付信息错误");
			return response;
		}
		msg = "获取支付信息成功";
		response.getResult().setResult("1");
		response.getResult().setMessage(msg);
		return response;
	}

	/**
	 * 获取我的话题
	 * 
	 * @param getCartRequest
	 * @return
	 */
	@ServiceMethod(method = "user.myTopicList", version = "1.0", needInSession = NeedInSessionType.NO, httpAction = HttpAction.GET)
	public Response myTopicList(GetCartRequest getCartRequest) {
		Response response = new Response();
		String msg = "";
		Integer page = getCartRequest.getPageCount();
		Long userId = getCartRequest.getUserId();
		
		if(userId==null||StringUtils.isBlank(userId.toString()))
		{
			response.getResult().setResult("0");
			response.getResult().setMessage("参数不合法");
			return response;
		}

		try {
			User user = null;
			ForumTopic forumTopic = new ForumTopic();
			forumTopic.setUserId(Integer.valueOf(userId.toString()));

			PageBean<ForumTopic> pageBean = new PageBean<ForumTopic>();
			pageBean.setParameter(forumTopic);
			pageBean.setPage(page);

			List<ForumTopic> forumTopicList = forumTopicService
					.findForumTopicByConditions(pageBean).getResult();
			List<TopicDTO> topicList = new ArrayList<TopicDTO>();
			Map<String, Object> data = new HashMap<String, Object>(5);
			if (forumTopicList != null && forumTopicList.size() > 0) {
				for (ForumTopic tp : forumTopicList) {
					TopicDTO topic = new TopicDTO();

					topic.setCareaterTime(tp.getCreateTime().toString());
					topic.setContent(tp.getContent());
					if (tp.getUserId() != null) {
						topic.setCreaterId(Long.parseLong(tp.getUserId()
								.toString()));
						user = userService.selectByUserId(tp.getUserId());
					}
					if (user != null) {
						topic.setCareaterLevel(user.getvLevel().toString());
						topic.setCreaterImgUrl(user.getPhone());
						topic.setCreaterName(user.getLoginName());
					}

					List<ForumImage> forumImgList = forumImageService
							.findForumImageByTopicId(tp.getTopicId());

					List<ImageDTO> imgList = new ArrayList<ImageDTO>();
					ImageDTO img = null;
					for (ForumImage formImage : forumImgList) {
						img = new ImageDTO();
						img.setImgUrl(formImage.getUrl());
						imgList.add(img);
					}
					topic.setImgList(imgList);
					topic.setIsRecommend(Boolean.parseBoolean(tp
							.getIsRecommend() == 1 ? "true" : "false"));

					/*
					 * topic.setLatestReplierName(latestReplierName);
					 * topic.setLatestReplyTime(latestReplyTime);
					 * topic.setReplyCount(replyCount);
					 */
					topic.setTitle(tp.getTitle());
					topic.setTopicId(Long.parseLong(tp.getTopicId().toString()));
					topic.setVisitCount(100);
					topicList.add(topic);
				}
			}

			response.setData(topicList);

		} catch (Exception e) {
			logger.error("myTopicList error", e);
			response.getResult().setResult("0");
			response.getResult().setMessage("获取我的话题错误");
			return response;
		}
		msg = "获取我的话题成功";
		response.getResult().setResult("1");
		response.getResult().setMessage(msg);
		return response;
	}

	/**
	 * 获取我的优惠卷
	 * 
	 * @param getOrderRequest
	 * @return
	 */
	@ServiceMethod(method = "user.getCouponList", version = "1.0", needInSession = NeedInSessionType.NO, httpAction = HttpAction.GET)
	public Response getCouponList(GetOrderRequest getOrderRequest) {
		Response response = new Response();
		String msg = "";

		Integer page = getOrderRequest.getPageCount();
		Integer status = getOrderRequest.getStatus();
		Long userId = getOrderRequest.getUserId();
		
		if(userId==null||StringUtils.isBlank(userId.toString()))
		{
			response.getResult().setResult("0");
			response.getResult().setMessage("参数不合法");
			return response;
		}
		
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		
		try {
			PageBean<ProDto> pageBean = new PageBean<ProDto>();
			pageBean.setPageSize(6);
			if (null == page) {
				page = 1;
			}
			pageBean.setPage(page);
			pageBean = couponService.getlistCouponByState(pageBean,
					Integer.valueOf(userId.toString()), 0);
			List<ProDto> proDto = pageBean.getResult();

/*			List<CouponDTO> couponList = new ArrayList<CouponDTO>();
			for (ProDto pro : proDto) {
				CouponDTO coupon = new CouponDTO();
				coupon.setDeadline(pro.getEndTime().toString());
				coupon.setDescribe(pro.getCouponName());
				coupon.setIsAvailable(Boolean.parseBoolean(pro.getIsUse()
						.toString()));
				String dateString =formatter.format(pro.getStartTime());
				coupon.setStartTime(dateString);
				coupon.setType(Integer.parseInt(pro.getIssueType().toString()));
				coupon.setValue(pro.getCouponAmount());
				couponList.add(coupon);
			}*/
			response.setData(proDto);

		} catch (Exception e) {
			logger.error("getCouponList error", e);
			response.getResult().setResult("0");
			response.getResult().setMessage("获取我的优惠卷错误");
			return response;
		}

		msg = "获取我的优惠卷成功";
		response.getResult().setResult("1");
		response.getResult().setMessage(msg);
		return response;
	}
	
	/**
	 * 获取用户信息
	 * @param getUserInfoRequest
	 * @return
	 */
	@ServiceMethod(method = "user.getUserInfo", version = "1.0", needInSession = NeedInSessionType.NO, httpAction = HttpAction.GET)
	public Response getUserInfo(GetUserInfoRequest getUserInfoRequest) {
		Response response = new Response();
		String msg = "";

		Integer userId = getUserInfoRequest.getUserId();
		
		if(userId==null||StringUtils.isBlank(userId.toString()))
		{
			response.getResult().setResult("0");
			response.getResult().setMessage("参数不合法");
			return response;
		}
		
		try {
			User user = userService.selectByUserId(userId);

			response.setData(user);

		} catch (Exception e) {
			logger.error("getUserInfo error", e);
			response.getResult().setResult("0");
			response.getResult().setMessage("获取用户信息错误");
			return response;
		}

		msg = "获取用户信息成功";
		response.getResult().setResult("1");
		response.getResult().setMessage(msg);
		return response;
	}
	
	/**
	 * 保存用戶信息
	 * @param saveUserInfoRequest
	 * @return
	 */
	@ServiceMethod(method = "user.saveUserInfo", version = "1.0", needInSession = NeedInSessionType.NO, httpAction = HttpAction.POST)
	public Response saveUserInfo(SaveUserInfoRequest saveUserInfoRequest) {
		Response response = new Response();
		String msg = "";

		Integer gender = saveUserInfoRequest.getGender();
		String birthday = saveUserInfoRequest.getBirthday();
		String nickName = saveUserInfoRequest.getNickName();
		Integer userId = saveUserInfoRequest.getUserId();
	    Integer sexualOrientation=saveUserInfoRequest.getSexualOrientation();
	    Integer marriageStatus=saveUserInfoRequest.getMarriageStatus();
		String province=saveUserInfoRequest.getProvince();
		String city=saveUserInfoRequest.getCity();
		Integer level=saveUserInfoRequest.getLevel();
		
		if(userId==null||StringUtils.isBlank(userId.toString()))
		{
			response.getResult().setResult("0");
			response.getResult().setMessage("参数不合法");
			return response;
		}
		
		try {
			User userNew = userService.selectByUserId(userId);
			if(nickName!=null&&StringUtils.isNotBlank(nickName))
			    userNew.setAccountName(nickName);
			if(birthday!=null&&StringUtils.isNotBlank(birthday))
			    userNew.setBirthday(birthday);	
			if(gender!=null&&StringUtils.isNotBlank(gender.toString()))
			    userNew.setSex(gender);
			if(sexualOrientation!=null&&StringUtils.isNotBlank(sexualOrientation.toString()))
			    userNew.setSexualOrientation(sexualOrientation);
			if(marriageStatus!=null&&StringUtils.isNotBlank(marriageStatus.toString()))
			    userNew.setMarriageStatus(marriageStatus);
			if(province!=null&&StringUtils.isNotBlank(province))
			    userNew.setProvince(province);
			if(city!=null&&StringUtils.isNotBlank(city))
			    userNew.setCity(city);
			if(level!=null&&StringUtils.isNotBlank(level.toString()))
			    userNew.setvLevel(level);
			
			int temp = userService.updateByUserId(userNew);			
			User user = userService.selectByUserId(userNew.getcUserId());
			response.setData(user);
		} catch (Exception e) {
			logger.error("saveUserInfo error", e);
			response.getResult().setResult("0");
			response.getResult().setMessage("保存用戶信息错误");
			return response;
		}

		msg = "保存用戶信息成功";
		response.getResult().setResult("1");
		response.getResult().setMessage(msg);
		return response;
	}
	
	/**
	 * 修改密码
	 * @param updatePasswordRequest
	 * @return
	 */
	@ServiceMethod(method = "user.updatePassword", version = "1.0", needInSession = NeedInSessionType.NO, httpAction = HttpAction.POST)
	public Response updatePassword(UpdatePasswordRequest updatePasswordRequest) {
		Response response = new Response();
		String msg = "";

		Integer userId = updatePasswordRequest.getUserId();
		String newPassword = updatePasswordRequest.getNewPassword();
		String oldPassword = updatePasswordRequest.getOldPassword();
		
		if(userId==null||StringUtils.isBlank(userId.toString()))
		{
			response.getResult().setResult("0");
			response.getResult().setMessage("参数不合法");
			return response;
		}
		
		try {
			User user = userService.selectByUserId(userId);
			if(user==null||user.getPassword()==null||!user.getPassword().equals(MD5Util.md5(oldPassword)))
			{
				response.getResult().setResult("0");
				response.getResult().setMessage("密码不正确");
				return response;
			}
			user.setPassword(MD5Util.md5(newPassword));
			Integer one = userService.updateByUserId(user);
			response.setData(user);
		} catch (Exception e) {
			logger.error("updatePassword error", e);
			response.getResult().setResult("0");
			response.getResult().setMessage("修改密码错误");
			return response;
		}

		msg = "修改密码成功";
		response.getResult().setResult("1");
		response.getResult().setMessage(msg);
		return response;
	}
	
	/**
	 * 绑定手机
	 * @param bindMobileRequest
	 * @return
	 */
	@ServiceMethod(method = "user.bindMobile", version = "1.0", needInSession = NeedInSessionType.NO, httpAction = HttpAction.POST)
	public Response bindMobile(BindMobileRequest bindMobileRequest) {
		Response response = new Response();
		String msg = "";

		Integer userId = bindMobileRequest.getUserId();
		String mobile = bindMobileRequest.getMobile();
		String verifyCode = bindMobileRequest.getVerifyCode();
		
		if(userId==null||StringUtils.isBlank(userId.toString()))
		{
			response.getResult().setResult("0");
			response.getResult().setMessage("参数不合法");
			return response;
		}
		
		try {
			String code = JedisManager.getString(mobile + "MOBILE_VALID");
			if (!code.equals(verifyCode)) {
				response.getResult().setResult("0");
				response.getResult().setMessage("验证码不正确");
				return response;
			}
			User user = userService.selectByUserId(userId);
			user.setMobile(mobile);
			int record = userService.updateByUserId(user);
		} catch (Exception e) {
			logger.error("updatePassword error", e);
			response.getResult().setResult("0");
			response.getResult().setMessage("绑定手机错误");
			return response;
		}

		msg = "绑定手机成功";
		response.getResult().setResult("1");
		response.getResult().setMessage(msg);
		return response;
	}
	
	/**
	 * 上传用户图像
	 * @param uploadUserPhotoRequest
	 * @return
	 * @throws Throwable
	 */
	@ServiceMethod(method = "user.uploadUserPhoto", version = "1.0",needInSession = NeedInSessionType.NO, httpAction = HttpAction.POST)
	public Response uploadUserPhoto(UploadUserPhotoRequest uploadUserPhotoRequest) throws Throwable {
		Response response = new Response();
		String msg = "";
		String fileType = uploadUserPhotoRequest.getPhoto().getFileType();
		int length = uploadUserPhotoRequest.getPhoto().getContent().length;
		Integer userId =uploadUserPhotoRequest.getUserId();
		if(userId==null||StringUtils.isBlank(userId.toString()))
		{
			response.getResult().setResult("0");
			response.getResult().setMessage("参数不合法");
			return response;
		}
		//ClassPathResource outFile = new ClassPathResource("/");
		try {
			InputStream inputStream = new ByteArrayInputStream(uploadUserPhotoRequest.getPhoto().getContent()); 
			String imgUrl = UploadFileUtil.uploadFile(inputStream,
					"png", null);
			User user = userService.selectByUserId(userId);
			user.setHeadUrl(imgUrl);
			int record = userService.updateByUserId(user);
		} catch (Exception e) {
			logger.error("updatePassword error", e);
			response.getResult().setResult("0");
			response.getResult().setMessage("上传用户图像错误");
			return response;
		}  
		//FileCopyUtils.copy(uploadUserPhotoRequest.getPhoto().getContent(), new File("e:\\tttttttttttt.png"));
		response.getResult().setResult("1");
		response.getResult().setMessage("上传用户图像成功");
		return response;
	}
}
